package com.sky.service.common.impl;

import com.sky.result.Result;
import com.sky.service.common.CommonService;
import com.sky.utils.AliOssUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * TODO
 *
 * @Author: Zhy
 * @Date: 2025-01-19 19:57
 * @Version: 1.0
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class CommonServiceImpl implements CommonService {
	private final AliOssUtil aliOssUtil;

	@Override
	public Result<String> upload(byte[] bytes, String fileName) {

		String url = aliOssUtil.upload(bytes, fileName);
		return Result.success(url);
	}
}
